package org.htmlparser.parserapplications.filterbuilder.layouts;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.LayoutManager2;
import java.io.Serializable;

public class VerticalLayoutManager
  implements LayoutManager2, Serializable
{
  public void addLayoutComponent(Component paramComponent, Object paramObject)
  {
  }

  public void addLayoutComponent(String paramString, Component paramComponent)
  {
  }

  public float getLayoutAlignmentX(Container paramContainer)
  {
    return 0F;
  }

  public float getLayoutAlignmentY(Container paramContainer)
  {
    return 0F;
  }

  public void invalidateLayout(Container paramContainer)
  {
  }

  public void layoutContainer(Container paramContainer)
  {
    while (true)
    {
      int i1;
      int i2;
      synchronized (paramContainer.getTreeLock())
      {
        Insets localInsets = paramContainer.getInsets();
        int i = localInsets.left;
        int j = localInsets.top;
        int k = paramContainer.getComponentCount();
        int l = 0;
        i1 = 0;
        if (i1 >= k)
          break label187;
        Component localComponent2 = paramContainer.getComponent(i1);
        if (!(localComponent2.isVisible()))
          break label181;
        Dimension localDimension2 = localComponent2.getPreferredSize();
        l = Math.max(l, localDimension2.width);
        localComponent2.setSize(localDimension2.width, localDimension2.height);
        localComponent2.setLocation(i, j);
        j += localDimension2.height;
        break label181:
        if (i2 < k)
        {
          Component localComponent1 = paramContainer.getComponent(i2);
          if (!(localComponent1.isVisible()))
            break label193;
          Dimension localDimension1 = localComponent1.getSize();
          localDimension1.width = l;
          localComponent1.setSize(localDimension1.width, localDimension1.height);
          break label193:
        }
        label181: label187: label193: return;
      }
    }
  }

  public Dimension maximumLayoutSize(Container paramContainer)
  {
    return preferredLayoutSize(paramContainer);
  }

  public Dimension minimumLayoutSize(Container paramContainer)
  {
    return preferredLayoutSize(paramContainer);
  }

  public Dimension preferredLayoutSize(Container paramContainer)
  {
    while (true)
    {
      int j;
      synchronized (paramContainer.getTreeLock())
      {
        Dimension localDimension1 = new Dimension(0, 0);
        int i = paramContainer.getComponentCount();
        j = 0;
        if (j < i)
        {
          Component localComponent = paramContainer.getComponent(j);
          if (!(localComponent.isVisible()))
            break label146;
          Dimension localDimension2 = localComponent.getPreferredSize();
          localDimension1.width = Math.max(localDimension1.width, localDimension2.width);
          localDimension1.height += localDimension2.height;
          break label146:
        }
        Insets localInsets = paramContainer.getInsets();
        localDimension1.width += localInsets.left + localInsets.right;
        localDimension1.height += localInsets.top + localInsets.bottom;
        label146: return localDimension1;
      }
    }
  }

  public void removeLayoutComponent(Component paramComponent)
  {
  }
}